package com.jstyle.beatecg.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.jstyle.beatecg.fragment.ExerciseHistoryFragment;
import com.jstyle.beatecg.fragment.HealthHistoryFragment;
import com.jstyle.beatecg.fragment.HrvReportHistoryFragment;

/**
 * Created by Administrator on 2017/12/25.
 */

public class HistoryFragmentAdapter extends FragmentPagerAdapter {
    String[] title;

    public HistoryFragmentAdapter(FragmentManager fm, String[] title) {
        super(fm);
        this.title = title;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                return ExerciseHistoryFragment.newInstance("", "");
            case 1:
                return HealthHistoryFragment.newInstance("", "");
            case 2:
                return HrvReportHistoryFragment.newInstance("", "");

        }
        return null;
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }


}
